<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    // 数组检测
    //1.instanceof
    let arr = []
    let arrayLike = {'1':'你好',length:2}
    console.log(arr instanceof Array)   // true

    // 2.Array.isArray
    console.log(Array.isArray(arr)) // true

    // 3.Object.prototype.toString.call(arr)
    console.log(Object.prototype.toString.call(arr).slice(8,-1)) // Array
    
    // 4.isPrototypeOf
    console.log(Array.prototype.isPrototypeOf(arr)); // true
</script>
</body>
</html>